package top.lyc829.leetcode.T344;

import java.util.Arrays;

class Solution {
    public void reverseString(char[] s) {

        int len = s.length;

        for (int i = 0; i < len / 2; i++) {
            char tmp = s[i];
            s[i] = s[len - i - 1];
            s[len - i - 1] = tmp;
        }

        System.out.println(Arrays.toString(s));
    }

    public static void main(String[] args) {
        Solution s = new Solution();
        s.reverseString(new char[]{'h', 'e', 'l', 'l', 'o'});
    }
}